<%@page import="com.netcracker.DAO.CustomerDAO"%>
<%@page import="com.netcracker.DAO.Customer"%>
<%@page import="com.netcracker.practice.test"%>
<%@page import="com.netcracker.framework.jdbc.oracle.JDBCType"%>
<%@page import="com.netcracker.framework.jdbc.ResultSetHandler"%>
<%@page import="com.netcracker.ejb.core.NCObject"%>
<%@page import="com.netcracker.ejb.core.ILoadingService"%>
<%@page import="java.sql.SQLException"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="com.netcracker.ejb.core.NCCoreInternals"%>

<%@ page import="com.netcracker.jsp.UniPage" %>
<%@ page import="java.math.BigInteger" %>
<%@ page import="com.netcracker.jsp.RedirectException" %>
<%@ page import="com.netcracker.jsp.PageDesign" %>
<%@ page import="com.netcracker.jsp.html.Code" %>
<%@ page import="com.netcracker.jsp.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%!
    public class ThisPage extends com.netcracker.jsp.ModernPage {

        private String word = "";
        
        public String firstName;
        public String lastName;
        public String age;
        public String email;
        public String primaryPhone;
        public String fax;

        public ThisPage() {
            // just example
            setPageUrl("/practice/aplha");
        }

        protected void parseParameters() {
            word = getParameter("id");
            test t = new test();
        }

        protected void init() throws Exception {
            // This block will init a NC Design (NC Header and navigation path).

            ModernDesign theDesign = makeDesign();
            NavigationPath navigationPath = new UniPath();

            setPageInfo( "some path");
            navigationPath.addItem("some path");
            theDesign.setNavigationPath(navigationPath);
            setPageDesign(theDesign);
        }
        private String name;

        protected void printWindowContent() throws Exception {

            //method for visual representation
            out.println("Just " + word + " \"Hello World!\"");
            
           /* NCCoreInternals.jdbcInstance().executeSelect("select name from nc_objects where object_id = ?", new Object[][]{{JDBCType.STRING, new BigInteger("9135921994613356285")}}, new ResultSetHandler() {
                public Object onResultSet(ResultSet rs) throws SQLException {
                    while (rs.next()) {
                        name = rs.getString(1);
                    }

                    return name;
                }
            });
            
            out.println("<br>" + "Result: " + name);
            */
            Customer cust = CustomerDAO.getCustomer(word);
            firstName = new String(cust.getFirstName());
            lastName = new String(cust.getLastName());
            age = new String(cust.getAge());
            email = new String(cust.getEmail());
          //  primaryPhone = new String(cust.getPrimaryPhone());
           // fax = new String(cust.getFax());
            
            out.println("<br>" + "Result: " + firstName + " " + lastName + " "+ age + " " + email);//+ " " + lastName + " "+ age + 
                     //email + " " + primaryPhone + " " + fax);

        }

        protected void execute() throws Exception {
            // method for logic implementation

        }
    }
%>
<%
    ThisPage thePage = new ThisPage();
    thePage.setPageContext(pageContext);
    try {
        thePage.debugSecureService();
    } finally {
    }
%>

